package com.szqhyxj.youxiangju.sys.components.view.popview;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import com.szqhyxj.youxiangju.R;

import butterknife.OnClick;

/**
 * Created by leung on 2018/11/5.
 */

public class GoShopPopView extends BaseDialog {

    private OnClickListener listener;

    public GoShopPopView(Context context) {
        super(context);
    }

    public GoShopPopView(Context context, String title, int imgId) {
        super(context);

    }

    @Override
    protected View initDialogView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.popview_shop, null);
        Button immediatelyGo = view.findViewById(R.id.goShop);
        immediatelyGo.setOnClickListener(this);
        Button nextTime = view.findViewById(R.id.cancel);
        nextTime.setOnClickListener(this);
        return view;
    }

    @OnClick({R.id.cancel, R.id.goShop})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.cancel:
                dismiss();
                break;
            case R.id.goShop:
                if (listener != null) {
                    listener.onClickConfirm(view);

                }
                break;
        }
    }



    public interface OnClickListener {
        void onClickConfirm(View v);
    }

    public void setOnClickListener(OnClickListener listener) {
        this.listener = listener;
    }

}



